﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyThuVien.DataAccess;

namespace QuanLyThuVien.Business
{
    class DocGiaBUS
    {
        DocGiaDAL dgDAl = new DocGiaDAL();

        public void ThemMoiDG(DocGia dg)
        {
            if(!dgDAl.KiemTraMaDG(dg.MaDG))
            {
                    dgDAl.ThemMoiDG(dg);
            }
            else
            {
                MessageBox.Show("Mã độc giả này đã tồn tại. Vui lòng nhập mã khác.", "QuanLyThuVien");
            }
        }

        public void SuaDG(DocGia dg)
        {
                dgDAl.SuaDG(dg);
        }

        public void XoaDG(string MaDG)
        {
                dgDAl.XoaDG(MaDG);
        }

        public void LoadLenDG(DataGridView dg)
        {
            dgDAl.LoadLenDG(dg);
        }

        public void LayMaDGLenCB(ComboBox cb)
        {
           dgDAl.LayMaDGLenCB(cb);
        }

        public string LayTenDGLenLable(string MaDG)
        {
          return  dgDAl.LayTenDGLenLable(MaDG);
        }

        public string LayChucVuLenCB(string MaDG)
        {
            return dgDAl.LayChucVuLenCB(MaDG);
        }

        public string LaodTenDGLenLable(string MaThe)
        {
          return dgDAl.LoadTenDGLenLable(MaThe);
        }

        public void LayTenDG(ComboBox cb)
        {
            dgDAl.LayTenDG(cb);
        }

        public void LoadLenDG(DataGridView dg, string MaDG)
        {
            dgDAl.LoadLenDG(dg, MaDG);
        }

        public void LoadLenDGTheoTenDG(DataGridView dg, string TenDG)
        {
            dgDAl.LoadLenDGTheoTenDG(dg, TenDG);
        }

        public void LoadLenDGTheoMaThe(DataGridView dg, string MaThe)
        {
            dgDAl.LoadLenDGTheoMaThe(dg, MaThe);
        }

        public void TimKiemTenDGNhanh(DataGridView dg, string DL)
        {
            dgDAl.TimKiemTenDGNhanh(dg, DL);
        }
    }

}
